package com.woniu.Service;

import com.github.pagehelper.PageInfo;
import com.woniu.entity.Account;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:Gwj
 * @Date:2024/7/1 16:04
 */
public interface AccountService {

    //登录方法
    Account findAccountToLogin(String accountName) throws Exception;

    //根据用户名查询用户信息
    Account findAccountByName(String accountName) throws Exception;

    //修改个人密码的重复验证
    Account checkPassword(String accountName, String oldPassword) throws Exception;

    //修改个人密码
    int updatePassword(String accountName, String newPassword) throws Exception;

    //登录的时候修改登录时间
    void upadateAccountLoginDate(Account account) throws Exception;

    //根据id修改用户信息
    int updateAccountInfoById(Account account) throws Exception;

    //删除用户 逻辑删除
    int changeAccountIsDeleted(Account account) throws Exception;

    //添加用户
    int addAccount(Account account) throws Exception;

    //查询所有用户 分页查询
    PageInfo<Account> findAccountByPage(int pageNum, int pageSize) throws Exception;

    //模糊查询用户  按名称查询
    PageInfo<Account> findAccountLikeName(int pageNum, int pageSize, String accountName,Byte isDelete, String accountType) throws Exception;


    //新增用户时的重名验证
    Account checkAccountName(String accountName) throws Exception;

    /**
     * 修改时的重名验证
     *
     * @param accountName
     * @param accountId
     * @return
     * @throws Exception
     */
    Account selectAccountByNameAndId(@Param("accountName") String accountName, @Param("accountId") Integer accountId) throws Exception;

    /**
     * 批量重置用户的密码
     *
     * @param list
     * @return
     * @throws Exception
     */
    int updateAccountPasswordByIds(List<Account> list) throws Exception;
}
